﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>>108Wo软装配饰设计中心 - Login</title>
<link type="text/css" rel="stylesheet" href="{CSS_PATH}108wo/style.css"/>
<script type="text/javascript" src="{JS_PATH}108wo/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{JS_PATH}108wo/jquery.pngFix.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(document).pngFix();
	var imglist = [[$('#boxer li:first').find('img').attr('src'), $('#boxer li:first').find('p').html()]];
	var i=1;
	function x(){
		var box=$('#boxer'), b=box.find("li:first"), o=imglist.shift();
		b.hide(function(){
			var p=b.next("li").find('p');
			box.append('<li class="player_photo"><img src="'+o[0]+'"><p></p></li>');	
			imglist.push([b.next("li").find('img').attr('src'),b.next("li").find("p").html()]);
			b.remove();
			b=box.find("li:last");
			p=b.find('p');
			$(p).text(o[1]);
			setTimeout(x,2000);
		})
	}
	$(function(){
	setTimeout(x,600);
	});
	
	$('.input').focus(function(){
		$(this).addClass("inputHover");					  
	})
	$('.input').blur(function(){
		$(this).removeClass("inputHover");					  
	})
	
	$('.button').hover(function(){
		$(this).addClass("hover");					  
	},function(){
		$(this).removeClass("hover");					  
	})


	//表单验证
	$('#email').blur(function(){
		if(/^[A-Za-z0-9_]+@[A-Za-z0-9_]+(\.[A-Za-z0-9_]+)+$/ig.test($('#email').val())) {
			$.getJSON('{APP_PATH}index.php?m=member&c=index&a=public_checkname_ajax&_={SYS_TIME}', {clientid:"username", username:$('#email').val()}, function(data){
				if(data==0) {
					$('#msgBox').html("<div class='err'>Email已被注册</div>");
					$('#msgBox').fadeIn("fast");
					setTimeout(function(){$("#msgBox").fadeOut("slow");},1000);
					$('#email').focus();
				}
			});
		}
	});


	$('#submit').click(function(){
		if(! /^[A-Za-z0-9_]+@[A-Za-z0-9_]+(\.[A-Za-z0-9_]+)+$/ig.test($('#email').val())) {
			$('#msgBox').html("<div class='err'>邮箱地址不正确！</div>");
			$('#msgBox').fadeIn("fast");
			setTimeout(function(){$("#msgBox").fadeOut("slow");},1000);
			$('#email').focus();
			return false;
		}

		if($.trim($('#password').val()).length < 6 || $.trim($('#password').val()).length > 18) {
			$('#msgBox').html("<div class='err'>密码在6-18位！</div>");
			$('#msgBox').fadeIn("fast");
			setTimeout(function(){$("#msgBox").fadeOut("slow");},1000);
			$('#password').focus();
			return false;
		}

		if($('#pwdconfirm').val() != $('#password').val()) {
			$('#msgBox').html("<div class='err'>两次密码不一致！</div>");
			$('#msgBox').fadeIn("fast");
			setTimeout(function(){$("#msgBox").fadeOut("slow");},1000);
			$('#pwdconfirm').focus();
			return false;
		}

		if($('#nickname').val().length < 1) {
			$('#msgBox').html("<div class='err'>请输入您的称呼！</div>");
			$('#msgBox').fadeIn("fast");
			setTimeout(function(){$("#msgBox").fadeOut("slow");},1000);
			$('#nickname').focus();
			return false;
		}

		if($('#protocol').attr('checked') != true) {
			$('#msgBox').html("<div class='err'>请勾选《服务条款》</div>");
			$('#msgBox').fadeIn("fast");
			setTimeout(function(){$("#msgBox").fadeOut("slow");},1000);
			$('#protocol').focus();
			return false;
		}


		if($('#qq').val() != '' && !/^\d\d\d\d\d+$/i.test($('#qq').val())) {
			$('#msgBox').html("<div class='err'>请正确的QQ号</div>");
			$('#msgBox').fadeIn("fast");
			setTimeout(function(){$("#msgBox").fadeOut("slow");},1000);
			$('#qq').focus();
			return false;
		}

		
		$('#msgBox').fadeIn("fast")
		$('#msgBox').html("<div class='loading'>注册中，请稍后...</div>");
		$.post($('#myform').attr('action'), $('#myform').serialize(), function(data){
			if(data == "{L('operation_success')}{$synloginstr}") {
				setTimeout(function(){$('#msgBox').html("<div class='suc'>注册成功，跳转中...</div>");},500);
				setTimeout(function(){$("#msgBox").fadeOut("fast");},1000);
				setTimeout(function(){location.href="{APP_PATH}index.php?m=member&c=index&a=account_manage_info";},1200);
			} else {
				setTimeout(function(){$('#msgBox').html("<div class='err'>"+data+"</div>");},500);				
				setTimeout(function(){$("#msgBox").fadeOut("slow");},1000);
			}
		});

		return false;
	});
	
})

function show_protocol() {
	window.open("{APP_PATH}index.php?m=member&c=index&a=register&protocol=1","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width=600, height=400");
}

/**
 * url跳转
 */
function redirect(url) {
	if(url.indexOf('://') == -1 && url.substr(0, 1) != '/' && url.substr(0, 1) != '?') url = $('base').attr('href')+url;
	location.href = url;
}
</script>
</head>
<body style="background:none">
<div id="msgBox">
	<div class="err">用户名或密码错误</div>
	<div class="suc">登录成功，跳转中...</div>
	<div class="loading">登录中，请稍后...</div>
</div>
<div id="reg">
	<div class="logo"><img src="{IMG_PATH}108wo/logo.gif" alt="108wo室内设计资源中心"/></div>
	<div class="picList">
		<div class="marquee">
			<ul id="boxer">
				{pc:content action="lists" catid="6" num="100" order="id DESC"}
					{loop $data $r}
					<li>
						<img src="{$r[thumb]}" width=220 height=125 />
						<p>{$r[title]}</p>
					</li>
					{/loop}
				{/pc}
			</ul>
		</div>
		<div class="form">
		<form method="post" action="{APP_PATH}index.php?m=member&c=index&a=register&uniqid={$_GET[uniqid]}" id="myform" onsubmit="return false;" name="myform">
			<div class="fm">
				<h1>会员注册</h1>
				<ul>
					<li>会员类型
						{loop $modellist $k $v}
						<label class="type"><input name="modelid" type="radio" value="{$k}" {if $k==$modelid}checked{/if} onclick="changemodel($(this).val())" />{$v['name']}</label>
						{/loop}
					</li>
					<li>电子邮箱<input type="text" id="email" name="email" class="input"/></li>
					<li>登录密码<input type="password" id="password" name="password" class="input"/></li>
					<li>确认密码<input type="password" name="pwdconfirm" id="pwdconfirm" class="input" /></li>
					<li>您的称呼<input type="text" id="nickname" name="nickname" class="input"/></li>
					<li>常用QQ <input type="text" id="qq" name="info[qq]" class="input"/></li>
					{if $member_setting['choosemodel']}
					<!--是否开启选择会员模型选项-->
					<script language="JavaScript">
					<!--
						function changemodel(modelid) {
							redirect('{APP_PATH}index.php?m=member&c=index&a=register&modelid='+modelid+'&siteid={$siteid}&uniqid={$_GET[uniqid]}');
						}
					//-->
					</script>
					{/if}
					<li style="padding-left:62px;"><input type="checkbox" name="protocol" id="protocol" class="checkbox"/><span>我已阅读并接受<a href="javascript:void(0);" onclick="show_protocol();return false;">《服务条款》</a></span></li>
					<li style="padding-left:62px;"><button type="submit" name="submit" id="submit" value="{L('agree_protocol_post')}" class="button">立即注册</button><button type="reset" class="button">取消</button></li>
				</ul>
			</div>	
			<div class="formBg"></div>
			<input type="hidden" name="siteid" value="{$siteid}" />
			<input type="hidden" name="doajax" id="doajax" value="1">
			<input type="hidden" name="dosubmit" value="1">
		</form>
		</div>			
	</div>
	<div class="copyright">
		<span>Copyright©2010 108wo Inc. All rights reserved. </span><br />
		<a target="blank" href="http://wpa.qq.com/msgrd?V=1&Uin=1605110027&Site=108wo.com&Menu=yes" class="msg">给我们留言</a>|<script src="http://s20.cnzz.com/stat.php?id=3095460&web_id=3095460" language="JavaScript"></script>
	</div>
</div>
</body>
</html>